/**
	* Operate Notification Module.
	*/
define([
	'jquery', 
	'messager'
], function($, messager) {
	var VamMessage;
	VamMessage = (function () {
		function VamMessage () {
			this.defaults = {
				"type": "info",
		    "status": "info",
		    "message": "Default Message.",
		    "url": "Default Url.",
		    "showCloseButton": true,
		    "data": {}
			};
			this.settings = {};
		}
		VamMessage.prototype.init = function (options, type) {
			Messenger.options = {
				extraClasses: 'messenger-fixed messenger-on-bottom messenger-on-right',
    		theme: 'flat'
    	};
			$.extend(this.settings, this.defaults, options);
			this.settings.status = type || this.settings.status;
		};
		VamMessage.prototype.renderMsg = function (status) {
			if (status === 'success') {
				this.settings.type = 'success';
			} else if (status === 'failure') {
				this.settings.type = 'error';
			} else {
				this.settings.type = 'info';
			}
			// console.log(this.settings);
			Messenger().post(this.settings);
		};
		VamMessage.prototype.sendMsg = function () {
			var status = this.settings.status;
			this.renderMsg(status);
		};
		VamMessage.prototype.messager = function (options, type) {
			this.init(options, type);
			this.sendMsg();
		};
		return VamMessage;
	})();
	return new VamMessage();
});